<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>图书管理页面</title>
</head>
<script>
    function del() {
        return confirm("是否要删除这本书？");
    }
</script>
<body>
<h1>图书管理页面</h1>
<h3>欢迎您：${sessionScope.user.username}</h3>
<a href="/user/add_book.jsp">添加图书</a>
<br>
<table border="solid 1px">
    <tr>
        <th>ID</th>
        <th>TITLE</th>
        <th>PUBLISHER</th>
        <th>PRICE</th>
        <th>OPERATIONS</th>
    </tr>
    <c:forEach var="book" items="${sessionScope.books}">
        <tr>
            <th>${book.id}</th>
            <th>${book.title}</th>
            <th>${book.publisher}</th>
            <th>${book.price}</th>
            <th>
                <a href="/book/detailById/${book.id}">详情</a>
                <a href="/book/deleteById/${book.id}" onclick="return del()">删除</a>
                <a href="/book/alertById/${book.id}">修改</a>
            </th>
        </tr>
    </c:forEach>
</table>
<a href="/user/signOut">退出登陆</a>
</body>
</html>
